package com.lyf.boot.modules.system.entity.dto;

import com.lyf.boot.base.system.entity.OssConfig;
import com.lyf.boot.validate.group.AddGroup;
import com.lyf.boot.validate.group.EditGroup;
import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import java.io.Serial;
import java.io.Serializable;

/**
 * @author Luyufan
 * @date 2023/8/15 15:27
 */
@Data
@AutoMapper(target = OssConfig.class)
public class OssConfigDto implements Serializable {

    @Serial
    private static final long serialVersionUID = 5493767120205326977L;

    /**
     * 配置id
     */
    @NotNull(message = "配置id不能为空", groups = {EditGroup.class})
    private Long ossId;

    /**
     * 平台类型
     */
    @NotBlank(message = "平台类型不能为空", groups = {AddGroup.class, EditGroup.class})
    private String platformType;

    /**
     * 平台
     */
    @NotBlank(message = "平台不能为空", groups = {AddGroup.class, EditGroup.class})
    private String platform;

    /**
     * 是否启用：0.禁用 1.启用
     */
    private Integer status;

    /**
     * 存储服务器access-key
     */
    private String accessKey;

    /**
     * 存储服务器secret-key
     */
    private String secretKey;

    /**
     * 服务器域名
     */
    private String endPoint;

    /**
     * 存储桶名称
     */
    private String bucketName;

    /**
     * 地区
     */
    private String region;

    /**
     * 访问域名
     */
    private String domain;

    /**
     * 基础路径
     */
    private String basePath;

    /**
     * 是否是默认
     */
    @NotNull(message = "是否默认不能为空", groups = {AddGroup.class, EditGroup.class})
    @Range(min = 0, max = 1, message = "是否默认取值不正确")
    private Integer isDefault;

    /**
     * 备注
     */
    private String remark;

}
